package com.hunlian.makelove.net.api;

import android.content.Context;

import com.hunlian.makelove.net.ServiceInterfaceDef;
import com.hunlian.makelove.net.InterfaceServiceVisit;
import com.hunlian.makelove.net.ResponseCallbackListener;
import com.hunlian.makelove.net.StringResponseCallbackListener;


/**
 * 意见反馈
 * @author zealjiang
 * @time 2015年11月23日下午2:08:24
 */
public class SuggestionServiceVisit extends InterfaceServiceVisit {

	public SuggestionServiceVisit(Context context) {
		super(context);

		setFunctionId(ServiceInterfaceDef.FUNC_ID_SUGGESTION);
	}

	// 填充参数
	public void setParamters(String id,String content) {
		paramterData.put("userId", id);
		paramterData.put("content", content);
	}

	public void getResult(final ResponseCallbackListener<String,Object> listener) {
		doPost(getParamter(), new StringResponseCallbackListener() {
			@Override
			public void onSuccess(String data) {
				//Printout.println("意见反馈 :"+data);

				if (listener != null) {
					listener.onSuccess(data);
				}
			}

			@Override
			public void onFailure(String errCode, String errMessage,String str) {
				if (listener != null) {
					listener.onFailure(errCode, errMessage,str);
				}
			}
		});
	}


}
